// PrPageAnimate.cpp : implementation file
//

#include "stdafx.h"
#include "ansieditor.h"
#include "PrPageAnimate.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPrPageAnimate dialog


CPrPageAnimate::CPrPageAnimate(CWnd* pParent /*=NULL*/)
	: CPrPage(CPrPageAnimate::IDD, pParent)
{
	//{{AFX_DATA_INIT(CPrPageAnimate)
	m_bPrevFromCurFrame = FALSE;
	m_nTimingBase = 0;
	//}}AFX_DATA_INIT
}


void CPrPageAnimate::DoDataExchange(CDataExchange* pDX)
{
	CPrPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPrPageAnimate)
	DDX_Control(pDX, IDC_SPIN_TIMINGBASE, m_spinTimingBase);
	DDX_Check(pDX, IDC_CHK_PREVIEW_FROM_CURFRAME, m_bPrevFromCurFrame);
	DDX_Text(pDX, IDC_TXT_TIMINGBASE, m_nTimingBase);
	DDV_MinMaxInt(pDX, m_nTimingBase, 1, 2000);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPrPageAnimate, CPrPage)
	//{{AFX_MSG_MAP(CPrPageAnimate)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPrPageAnimate message handlers

BOOL CPrPageAnimate::OnInitDialog() 
{
	m_nTimingBase = gpApp->m_options.nPrevAniTimingBase;
	m_bPrevFromCurFrame = gpApp->m_options.bPrevFromCurFrame;
	CPrPage::OnInitDialog();
	
	m_spinTimingBase.SetRange32(1, 2000);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

BOOL CPrPageAnimate::ValidateData()
{
	UpdateData();
	gpApp->m_options.nPrevAniTimingBase = m_nTimingBase;
	gpApp->m_options.bPrevFromCurFrame = m_bPrevFromCurFrame;
	return TRUE;
}